import request from '@/utils/request.js'

// 注册成为商户
export function merchantRegister(data) {
    return request({
        url: '/njnzzs/merchant/register',
        method: 'POST',
        data
    })
}

// 修改商户
export function merchantUpdate(data) {
    return request({
        url: '/njnzzs/merchant/update',
        method: 'PUT',
        data
    })
}

// 获取商户信息
export function myMerchantInfo(data) {
    return request({
        url: '/njnzzs/merchant/myMerchantInfo',
        method: 'GET',
        data
    })
}

// 平台抽成
export function merchantConfig(data) {
    return request({
        url: '/njnzzs/config/list',
        method: 'GET',
        data
    })
}

// 我的商户列表
export function merchantList(data) {
    return request({
        url: '/njnzzs/merchant/list',
        method: 'GET',
        data
    })
}

// 商户审核换货
export function exchangeApprove(data) {
    return request({
        url: '/njnzzs/merchant/exchangeApplies/approve',
        method: 'POST',
        data
    })
}

// 商户审核还货
export function returnApprove(data) {
    return request({
        url: '/njnzzs/merchant/returnApply/approve',
        method: 'POST',
        data
    })
}

// 提现明细
export function withdrawList(data) {
    return request({
        url: '/njnzzs/merchant/withdraw/list',
        method: 'GET',
        data
    })
}

// 提现
export function toWithdraw(data) {
    return request({
        url: '/njnzzs/merchant/withdraw',
        method: 'POST',
        data
    })
}

// 提现
export function getQrcode(data) {
    return request({
        url: '/njnzzs/merchant/qrCode',
        method: 'GET',
        data
    })
}

// 获取支付方式
export function clientLevelPaymentTypes(data) {
    return request({
        url: '/njnzzs/merchant/clientLevelPaymentTypes',
        method: 'GET',
        data
    })
}

// 设置支付方式
export function setPayment(data) {
    return request({
        url: '/njnzzs/merchant/client/setPayment',
        method: 'POST',
        data
    })
}